import http from './http.js'
import qs from 'qs'
//列表
export function list () {
  return http({
    method: 'GET',
    url: `/manage/role/list`
  })
}
//设置角色权限
export function setPres (role) {
  return http({
    method: 'post',
    url: '/manage/role/update',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: qs.stringify({ ...role })
  })
}
//添加角色
export function addRole (roleName) {
  return http({
    method: 'post',
    url: '/manage/role/add',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: qs.stringify({ roleName })
  })
}